<?xml version="1.0"?>
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
          xmlns:o="urn:schemas-microsoft-com:office:office"
          xmlns:x="urn:schemas-microsoft-com:office:excel"
          xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
          xmlns:html="http://www.w3.org/TR/REC-html40">
  <ss:Styles>
    <ss:Style ss:ID="1">
      <ss:Alignment ss:Horizontal="Center" ss:Vertical="Center" />
      <ss:Font ss:Color="Red" ss:Size="16"/>
    </ss:Style>
    <ss:Style ss:ID="RightAlign">
      <ss:Alignment ss:Horizontal="Right"/>
    </ss:Style>
    <ss:Style ss:ID="CenterAlign">
      <ss:Alignment ss:Horizontal="Center"/>
    </ss:Style>
    <ss:Style ss:ID="RedText">
      <ss:Font ss:Color="Red"/>
    </ss:Style>
  </ss:Styles>
  <Worksheet ss:Name="Tk_Taisan">
    <Table>
      <!-- <Column /> -->
      <Column ss:Width="150"/>
      <Column ss:Width="110"/>
      <Column ss:Width="110" />
      <Column ss:Width="110" />
      <Column ss:Width="80" />
      <Column ss:Width="80" />
      <Row>
      </Row>
      <Row ss:StyleID="1" ss:Height="40">
        <Cell ss:MergeAcross="5"><Data ss:Type="String">Chi tiết sử dụng <%= @loai.TenLoai %></Data></Cell>
      </Row>

      <Row></Row>
      <Row ss:StyleID="CenterAlign">
        <Cell ss:MergeAcross="1"><Data ss:Type="String">Danh sách chi tiết các phòng sử dụng</Data></Cell>
      </Row>
      <Row>
        <Cell><Data ss:Type="String">Tên tài sản </Data></Cell>
        <Cell><Data ss:Type="String">Phòng</Data></Cell>
        <Cell><Data ss:Type="String">Người quản lí </Data></Cell>
        <Cell><Data ss:Type="String">Ngày bắt đầu sử dụng</Data></Cell>
        <Cell><Data ss:Type="String">Tình trạng</Data></Cell>
        <Cell><Data ss:Type="String">Sô lượng</Data></Cell>
      </Row>
      <% if @ctp.empty? then %>
          <Row>
            <Cell ss:MergeAcross="5" ss:StyleID="CenterAlign"><Data ss:Type="String">Không có!</Data></Cell>
          </Row>
      <% end %>
      <% @ctp.each_with_index do |chi_tiet, i| %>
          <Row>
            <Cell><Data ss:Type="String"><%= chi_tiet.tai_san.TenTS %></Data></Cell>
            <Cell><Data ss:Type="String"><%= chi_tiet.phong.TenPhongg %></Data></Cell>
            <% if chi_tiet.nguoi_sd_id != nil then %>
                <Cell ss:StyleID="RedText"><Data ss:Type="String"><%= chi_tiet.nhan_vien.TenNV %></Data></Cell>
            <% else %>
                <Cell><Data ss:Type="String">Không có </Data></Cell>
            <% end %>
            <Cell><Data ss:Type="String"><%= l chi_tiet.ngay_cap_nhat, :format => :custom %></Data></Cell>
            <% if chi_tiet.tinh_trang == "Đang Sửa" then %>
                <Cell ss:StyleID="RedText"><Data ss:Type="String"><%= chi_tiet.tinh_trang %></Data></Cell>
            <% else %>
                <Cell><Data ss:Type="String"><%= chi_tiet.tinh_trang %></Data></Cell>
            <% end %>
            <Cell ss:StyleID="CenterAlign"><Data ss:Type="Number"><%= chi_tiet.so_luong %></Data></Cell>
          </Row>
      <% end %>

    </Table>
  </Worksheet>
</Workbook>